<%-- 
    Document   : addcourse
    Created on : 2010-12-20, 19:44:55
    Author     : yiyang
--%>

<%@page contentType="text/html" pageEncoding="utf-8" import="java.util.*,course.*"%>
<%@include file="SessionCheck.jsp" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<%
        request.setCharacterEncoding("gb2312");
        response.setCharacterEncoding("gb2312");
        String name=request.getParameter("name");
        session.setAttribute("name",name);
        %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>添加课程</title>
<style type="text/css">
<!--
.STYLE2 {
	font-size: xx-large
}
.STYLE3 {color: #FF0000}
-->
</style>
    </head>
<body bgcolor="#CCCCCC">
    <%
    request.setCharacterEncoding("GB2312");
    String action=request.getParameter("action");
    if(action!=null&&action.equals("true"))
    {
        Course c=new Course();
        String courseName=request.getParameter("name");
        String courseType=request.getParameter("type");
        //courseType=new String(courseType.getBytes("8859_1"),"gb2312");
        String courseIntro=request.getParameter("introduction");
        String courseOutline=request.getParameter("teach_outline");
        String coursePlan=request.getParameter("teach_plan");
        String tId=teacher.getId();
        c.setCname(courseName);
        c.setCategory(courseType);
        c.setIntroduction(courseIntro);
        c.setTeachOutline(courseOutline);
        c.setTeachPlan(coursePlan);
        c.setTid(tId);
        c.add();
        out.print("<script>alert('添加成功！');window.navigate('addcontent.jsp');</script>");
        //response.sendRedirect("addcontent.jsp");
    }
    %>
<div align="center">
<table width="200" border="0" align="center" bordercolor="#000000" bgcolor="#FFFFFF">
  <tr>
    <td><img src="../images/rg.jpg" alt="" width="807" height="142" /></td>
  </tr>
  <tr>
    <td height="650" valign="top">
        <form  id="form" name="form" method="post" action="addcourse.jsp">
            <input type="hidden" name="action" value="true">
        <table width="785" border="1"  cellspacing="0" align="center">
        <tr>
          <td height="64" colspan="2"><div align="center"><span class="STYLE2">添加课程</span></div></td>
          </tr>
        <tr>
          <td height="25">课程名称</td>
          <td> 
              <div align="left">
                <input name="name" type="text" size="25">
              </div> 
              </td>
        </tr>
        <tr>
          <td><span class="STYLE3"></span>课程类别</td>
          <td>
                <div align="left">
                  <select name="type" id="select">
                    <option selected="selected">计算机类</option>
                    <option>数学类</option>
                    <option>艺术类</option>
                    <option>政治类</option>
                    <option>外语类</option>
                    <option>土木类</option>
                    <option>医学类</option>
                    <option>电子信息类</option>
                    <option>教育类</option>
                    <option>环境科学类</option>
                    <option>生命科学类</option>
                    <option>人文类</option>
                    <option>社科类</option>
                    <option>其他</option>
                  </select>
                </div>
              </td>
        </tr>
        <tr>
          <td height="134">课程简介</td>
          <td>
          
            <div align="left">
              <textarea name="introduction" id="textarea" cols="80" rows="10"></textarea>
  
           </div></td>
        </tr>
        <tr>
          <td>课程大纲</td>
          <td>
           
            <div align="left">
              <textarea name="teach_outline" id="textarea2" cols="80" rows="10"></textarea>
              
            </div></td>
        </tr>
        <tr>
          <td>教学计划</td>
          <td>
            <div align="left">
              <label>
                <textarea name="teach_plan" id="textarea4" cols="80" rows="10"></textarea>
                </label>
            </div></td>
        </tr>
        <!--<tr>
          <td>上传教学内容</td>
          <td>
   <p>上传文件1:<input type = "file" name = "File1" size = "20" maxlength = "20"><br>
      文件描述: <input type = "text" name = "File1" size = "30" maxlength = "50"></p>
   <p>上传文件2:<input type = "file" name = "File2" size = "20" maxlength = "20"><br>
      文件描述: <input type = "text" name = "File2" size = "30" maxlength = "50"></p>             
 </td>
        </tr>-->
        <tr>
          <td height="63" colspan="2">

              <div align="center">
                <input type="submit" name="button" id="button" value="提交" />
              　　　　　
              <input type="reset" name="button2" id="button2" value="取消" onclick="window.navigate('courseManage.jsp')"/>
              </div>

              </td>
          </tr>
      </table>
    </form> </td>
    
  </tr>
</table>
</div>

   
</body>
</html>
